<%@ page language="java" contentType="text/html;charset=UTF-8" %>
<%@ page import="com.gouwudai.gobbs.pojo.TbbsMasterGrade"%>
<%@ include file="../../common/common.jsp" %>
<%@ include file="master_pass.jsp" %>
<%
Integer mgId = Utility.parseInt(request.getParameter("mgId"));

IMasterGradeService masterGradeService = (IMasterGradeService)BeanManager.getBean("masterGradeService");
TbbsMasterGrade obj = masterGradeService.load(mgId);	
%>
<HTML>
<HEAD>
<title>编辑管理员等级信息</title>
<%@ include file="../../common/meta.inc" %>
<link href="css.css" rel="stylesheet" type="text/css">
<base target="_self">
<SCRIPT LANGUAGE="javascript" SRC="${pageContext.request.contextPath}/scripts/common-validator.js"></SCRIPT>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/prototype.js"></script>
<script language="javascript" src="${pageContext.request.contextPath}/scripts/buffalo/buffalo.js"></script>
<script language="javascript">
var END_POINT="${pageContext.request.contextPath}/buffalo";
var buffalo = new Buffalo(END_POINT);
function doSubmit() {

	form = document.theform;
	
	if(!validateForm(form))
		return;
		
    var obj = {};
	obj[Buffalo.BOCLASS] = "com.gouwudai.gobbs.pojo.TbbsMasterGrade";
	obj.mgId=<%=mgId%>;
	obj.gradeLevel=1;
	obj.gradeName=$F('gradeName');
	obj.remark=$F('remark');
    buffalo.remoteCall("masterGradeServiceAjaxService.update",[obj], function(reply) {
        ajaxSubmit(reply.getResult(),"","close");;
    });
}

function validateForm(form)
{
    if(!sl_check(form.gradeName,"等级名称",50,1)) return false;
    return sl_confirmUpdate();
}
</script>
</HEAD>
<BODY leftMargin=0 topMargin=0 rightmargin="0" bottommargin="0" onkeydown="javascript:chachEsc(window.event.keyCode)">
<form name="theform" method="post" action="master_grade_update.jsp">
						<table border="0" width="100%" cellspacing="0" cellpadding="0">
							<tr>
								<td><img border="0" src="${pageContext.request.contextPath}/club/admin/images/config.gif" align="absbottom"><font color="#215dc6"><b>新建管理员等级信息</b></font></td>
							</tr>
							<tr>
								<td>
								<hr noshade color="#808080" size="1">
								</td>
							</tr>
						</table>
						<table border="0" width="100%" cellspacing="3">	
							<tr>
								<td width="46%" align="right">等级名称:</td>
								<td width="49%"><input type="text" name="gradeName" id="gradeName" value="<%=obj.getGradeName() %>" onkeydown="javascript:nextKeyPress(this)" size="20"></td>
							</tr>	
							<tr>
								<td width="46%" align="right">备注:</td>
								<td width="49%">
									<textarea name="remark" id="remark" cols="17" rows="5"><%=Utility.trimNull(obj.getRemark()) %></textarea><script language="javascript">textAreaEx("remark",5)</script>
								</td>
							</tr>																																			
						</table>
						<table border="0" width="100%">
							<tr>
								<td align="right">
								<button class="btn" accessKey=s id="btnSave" name="btnSave" onclick="javascript:doSubmit();">保存(<u>S</u>)</button>
								&nbsp;&nbsp;
								<button class="btn" accessKey=c id="btnCancel" name="btnCancel" onclick="javascript:window.returnValue=null;window.close();">取消(<u>C</u>)</button>
								&nbsp;&nbsp;								
								</td>
							</tr>
						</table>
</form>
</BODY>
</HTML>

